package main

import "fmt"

func main() {
	var sum int = 0
	for i := 0; i <= 100; i++ {
		sum += i
		if sum > 20 {
			fmt.Println("当前数：", i)
			break
		}
	}

	fmt.Println("------------------------")

	var name string
	var pwd string

	for i := 0; i < 3; i++ {
		fmt.Println("请输入与用户名：")
		fmt.Scanln(&name)
		fmt.Println("请输入密码：")
		fmt.Scanln(&pwd)
		if name == "张无忌" && pwd == "888" {
			fmt.Println("登录成功")
			break
		} else {
			fmt.Println("登录失败")
		}
	}
}
